load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "table",
    srcs = [
        "column.go",
        "constraint.go",
        "index.go",
        "table.go",
    ],
    importpath = "github.com/pingcap/tidb/table",
    visibility = ["//visibility:public"],
    deps = [
        "//errno",
        "//expression",
        "//kv",
        "//meta/autoid",
        "//parser",
        "//parser/ast",
        "//parser/charset",
        "//parser/model",
        "//parser/mysql",
        "//parser/types",
        "//sessionctx",
        "//sessionctx/stmtctx",
        "//types",
        "//util/chunk",
        "//util/dbterror",
        "//util/hack",
        "//util/logutil",
        "//util/mock",
        "//util/sqlexec",
        "//util/timeutil",
        "//util/tracing",
        "@com_github_pingcap_errors//:errors",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "table_test",
    timeout = "short",
    srcs = [
        "column_test.go",
        "main_test.go",
        "table_test.go",
    ],
    embed = [":table"],
    flaky = True,
    race = "on",
    shard_count = 9,
    deps = [
        "//errno",
        "//expression",
        "//parser/ast",
        "//parser/charset",
        "//parser/model",
        "//parser/mysql",
        "//parser/terror",
        "//sessionctx",
        "//sessionctx/stmtctx",
        "//testkit/testsetup",
        "//types",
        "//util/collate",
        "//util/mock",
        "@com_github_stretchr_testify//require",
        "@org_uber_go_goleak//:goleak",
    ],
)
